package com.ruoyi.web.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.mapper.GuTodayMapper;
import com.ruoyi.web.domain.GuToday;
import com.ruoyi.web.service.IGuTodayService;

/**
 * 今日股票Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-16
 */
@Service
public class GuTodayServiceImpl implements IGuTodayService 
{
    @Autowired
    private GuTodayMapper guTodayMapper;

    /**
     * 查询今日股票
     * 
     * @param id 今日股票主键
     * @return 今日股票
     */
    @Override
    public GuToday selectGuTodayById(String id)
    {
        return guTodayMapper.selectGuTodayById(id);
    }

    /**
     * 查询今日股票列表
     * 
     * @param guToday 今日股票
     * @return 今日股票
     */
    @Override
    public List<GuToday> selectGuTodayList(GuToday guToday)
    {
        return guTodayMapper.selectGuTodayList(guToday);
    }

    /**
     * 新增今日股票
     * 
     * @param guToday 今日股票
     * @return 结果
     */
    @Override
    public int insertGuToday(GuToday guToday)
    {
        guToday.setCreateTime(DateUtils.getNowDate());
        guToday.setId(UUID.randomUUID().toString().trim().replaceAll("-", ""));
        return guTodayMapper.insertGuToday(guToday);
    }

    /**
     * 修改今日股票
     * 
     * @param guToday 今日股票
     * @return 结果
     */
    @Override
    public int updateGuToday(GuToday guToday)
    {
        guToday.setUpdateTime(DateUtils.getNowDate());
        return guTodayMapper.updateGuToday(guToday);
    }

    /**
     * 批量删除今日股票
     * 
     * @param ids 需要删除的今日股票主键
     * @return 结果
     */
    @Override
    public int deleteGuTodayByIds(String[] ids)
    {
        return guTodayMapper.deleteGuTodayByIds(ids);
    }

    /**
     * 删除今日股票信息
     * 
     * @param id 今日股票主键
     * @return 结果
     */
    @Override
    public int deleteGuTodayById(String id)
    {
        return guTodayMapper.deleteGuTodayById(id);
    }
}
